package com.hj.ipproxy.thread;

import java.util.HashMap;
import java.util.Stack;
import java.util.TreeSet;
import java.util.Vector;

public class ThreadTest1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//new ThreadTest1().init();
		//Stack<E>
		/*StringBuilder bf = new StringBuilder(); 
		//StringBuffer bf = new StringBuffer(); 
		 long startTime = System.currentTimeMillis();  
		for (int i = 0; i < 3000000; i++) {
			bf.append(i);
		}
		long endTime = System.currentTimeMillis();  
		System.out.println("cost time: "+(endTime-startTime));  */
		
		/*StringBuilder bd = new StringBuilder();
		bd.append(b);*/
		HashMap<Integer,Integer> ss = new HashMap<>();
		String a1 = new String("abc");
		System.out.println("1-"+a1.hashCode());
		String a2 = new String("abc");
		System.out.println("2-"+a2.hashCode());
		
		System.out.println(a1.equals(a2));
	}
	
	private void init() {
		final Outputer op = new Outputer();
		new Thread(new Runnable() {
			@Override
			public void run() {
				while (true) {
					try {
						Thread.sleep(10);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					
					op.outputs("cccccccccc");
				}
			}
		}).start();
		
		new Thread(new Runnable() {
			@Override
			public void run() {
				while (true) {
					try {
						Thread.sleep(10);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					
					op.outputs("bbbbbbbbbbbbbbbbb");
				}
			}
		}).start();
		
	}
}
